package J1_5;

import java.util.Scanner;

public class J105task1 {
    public static void main(String[] args) {
        int x,sun,cont;
        sun=0;
        cont=0;
        Scanner scanner =new Scanner(System.in);
        System.out.println("输入一个整数:");
        x=scanner.nextInt();
        for (int i=1;i<=x;i++){
            if (i%7==0){
                sun+=i;
                cont++;
            }
        }
        System.out.println("1~"+x+"个数里面,有"+cont+"个能被7整除,且和为:"+sun);
    }
}
